Smart submarines